from flask import request
import json

def getdata():
    data = request.data
    if request.method == "post":
        data = json.loads(data)
    else:
        data = request.form
    return data